<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>人员查询——人员管理——鑫四合珠宝管理</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="huyuzhu">
<!-- Le styles -->
<link href="${pageContext.request.contextPath}/css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="${pageContext.request.contextPath}/css/base.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/css/main.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap-affix.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.placeholder.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#name").placeholder();	
	pageSizeInit(<s:property value="user.page.pageSize"/>);
});
function query(pageIndex){
	$("#currentPage").attr("value",pageIndex);
	$("#qeuryForm").submit();
}
function pageSizeInit(pageSize){
	if(pageSize==10){
		$("#pageSize_10").attr("class","badge badge-important");
		$("#pageSize_20").attr("class","badge");
		$("#pageSize_50").attr("class","badge");
	}else if(pageSize==20){
		$("#pageSize_20").attr("class","badge badge-important");
		$("#pageSize_10").attr("class","badge");
		$("#pageSize_50").attr("class","badge");
	}else if(pageSize==50){
		$("#pageSize_50").attr("class","badge badge-important");
		$("#pageSize_10").attr("class","badge");
		$("#pageSize_20").attr("class","badge");
	}
	$("#pageValue").attr("value",pageSize);
}
function pageSizeClick(pageSize){
	pageSizeInit(pageSize);
	query(1);
}
</script>
</head>
<body>
<!-- 头部 -->
<s:include value="../header.jsp"/>
<!-- 主内容区开始 -->
<div class="conBox clearfix">
  <s:include value="menu.jsp">
	<s:param name="menuIndex" value="1"/>
  </s:include>
  <div class="mainBox">
    <h1>人员查询</h1>
    <div class="row-fluid InquiryBox">
    <s:form id="qeuryForm" action="queryUserList">
      <div class="span6"> 按角色查询：
      	<s:select name="user.userType" list="statisticsList" listKey="type" cssClass="w150" listValue="typeName" headerKey="0" headerValue="全部"/> 
      </div>
      <div class="span6">按名称查询：
        <s:textfield cssClass="w150" id="name" name="user.loginid" placeholder="请输入名称..."/>
        <s:submit cssClass="btn" value="查询"/>
        <s:hidden name="user.page.pageSize" value="10" id="pageValue"/>
        <s:hidden name="user.page.currentPage" value="1" id="currentPage"/>
      </div>
      </s:form>
    </div>
    <div class="ncBox">
      <s:a action="addUserPage" cssClass="btn"><i class="icon-plus"></i> 添加帐号</s:a>
      <s:if test="user.page.totalItem==0">
		<div class="noResult">
       	<h3>抱歉，未查询到符合条件的记录！</h3>
      	</div>
      </s:if>
      <s:else>
      <table class="table table-bordered table-hover">
        <thead>
        <tr>
          <th>ID</th>
          <th>名称</th>
          <th>角色</th>
          <th>性别</th>
          <th>电话</th>
          <th>QQ</th>
          <th>邮箱</th>
        </tr>
        </thead>
        <tbody>
        <s:iterator value="userList">
        <tr>
          <td><s:property value="userid"/></td>
          <td><a href="user_detailed.html"><s:property value="loginid"/></a></td>
          <td><s:property value="userTypeName"/></td>
          <td><s:if test="gender==1">男 </s:if><s:else>女</s:else></td>
          <td><s:property value="telephone"/></td>
          <td><s:property value="qq"/></td>
          <td><s:property value="email"/></td>
        </tr>
        </s:iterator>
        </tbody>
      </table>
       <div class="row-fluid pagination">
        <div class="span5">每页条数：
        <a href="#" class="badge badge-important" id="pageSize_10" onclick="pageSizeClick(10);">10</a>
        <a href="#" class="badge" id="pageSize_20" onclick="pageSizeClick(20);">20</a> 
        <a href="#" class="badge" id="pageSize_50" onclick="pageSizeClick(50);">50</a></div>
        <div class="pagination-right">
          <ul>
            <li <s:if test="user.page.currentPage==1">class="disabled"</s:if>><a href="#" onclick="query(1)">首页</a></li>
            <li <s:if test="user.page.currentPage==1">class="disabled"</s:if>><a href="#" onclick="query(<s:property value="user.page.prePage"/>)">上一页</a></li>
            <li <s:if test="user.page.currentPage==user.page.totalPage || user.page.totalPage == 0">class="disabled"</s:if>><a href="#" onclick="query(<s:property value="user.page.nextPage"/>)">下一页</a></li>
            <li <s:if test="user.page.currentPage==user.page.totalPage || user.page.totalPage == 0">class="disabled"</s:if>><a href="#" onclick="query(<s:property value="user.page.totalPage"/>)">尾页</a></li>
          </ul>
        </div>
      </div>
      </s:else>
    </div>
  </div>
</div>
<!-- 主内容区结束 --> 
<!-- 尾部 -->
<s:include value="../bottom.jsp"/>
</body>
</html>